home *** CD-ROM | disk | FTP | other *** search
- import java.util.Date;
- import vrml.Event;
- import vrml.field.ConstSFBool;
- import vrml.field.SFTime;
- import vrml.node.Script;
-
- public class OpenSesame extends Script {
- OpenDialog myDialog;
- SFTime startTime;
- Date date;
-
- public void initialize() {
- this.myDialog = new OpenDialog(this);
- this.startTime = (SFTime)((Script)this).getEventOut("startTime");
- this.date = new Date();
- }
-
- public void processEvent(Event var1) {
- if (var1.getName().equals("entered")) {
- ConstSFBool var2 = (ConstSFBool)var1.getValue();
- if (var2.getValue()) {
- this.myDialog.show();
- return;
- }
-
- this.myDialog.hide();
- }
-
- }
-
- public void openDoor() {
- this.startTime.setValue((double)this.date.getTime() / (double)1000.0F + (double)1.0F);
- }
- }
-